<?php
	include('./db/dbconn.php');
	//if (true) {
	if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
		$id = $_GET['id'];
		// select from mysql
		$sql = "select sense_id, sense_name, sense_desc from sense where sense_id='$id' limit 1";
		$check_query = mysqli_query($conn, $sql);
			
		if ($result = mysqli_fetch_array($check_query)) {
			
			$sense_name = $result['sense_name'];
			$a = iconv('gbk', 'utf-8', $sense_name);
			
			
			$d = $result['sense_desc'];
			$dd = "<strong>" . $a . ": </strong>" . iconv('gbk', 'utf-8', $d);
			//echo $dd;
			//echo $desc;
			$json = array("status" => "success", "data" => "$dd", "sense_name" => "$a");
			echo json_encode($json);
		} else {
			$err = array("status" => "error", "data" => "none");
			echo json_encode($err);
		}
	}else{
		$err = array("status" => "error", "data" => "none");
		echo json_encode($err);
	}
?>